package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import org.springframework.stereotype.Component;

@Component
public class ExportOpenShutConvertor implements FieldValueConvert {
    @Override
    public Object convert(Object bean, Object value, DataDumpField dataField) {
        System.err.println("value="+value);
        if (value == null) {
            return "关闭";
        }
        if ((value instanceof Number && ((Number) value).intValue() == 1) || value.equals("1") || value.equals("Y")) {
            return "开启";
        }
        return "关闭";
    }
}
